﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FundRaising.BLL;
using FundRaising.DAL._FR_DSTableAdapters;
using FundRaising.DAL;

namespace FundRaising.GUI
{
    public partial class RequestConv : System.Web.UI.Page
    {
        RequestBLL BLL = new RequestBLL();
        DAL._FR_DS.RequestDataTable table = new _FR_DS.RequestDataTable();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            
            table = BLL.GetRequestByKey();
            FundLabel.Text = Convert.ToString(table[0][3]);
            AssoLabel.Text = Convert.ToString(table[0][1]);
            DomainLabel.Text = Convert.ToString(table[0][2]);
            RequestKey.Text = Convert.ToString(table[0][11]);
        }

        protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {

            DateTextBox.Text = Calendar1.SelectedDate.ToShortDateString();
        
        }

        protected void SaveCovButton_Click(object sender, EventArgs e)
        {   
            Guid FK = new Guid(Convert.ToString(table[0][11]));
            string ConvInit = ConvInitTextBox.Text;
            string ContactName = ContactNameTextBox.Text;
            string Date = DateTextBox.Text;
            string ContMethod = ContMethodTextBox.Text;
            string CovDescription = CovDescriptionTextBox.Text;
            string Summery = SummeryTextBox.Text;

            BLL.InsertReqConv(FK, ConvInit, ContactName, Date, ContMethod, CovDescription, Summery);
        }

        

        

       

       
    }
}
